#include <bits/stdc++.h>
using namespace std;
const int N = 14, M = 1 << N, mod = 1e8;
int n, m, k;
int g[N];
int f[N][M];
vector<int> state;
vector<int> head[M];
bool check(int state) { return !(state & state << 1); }
int main() {
  cin >> n >> m;
  // 土地情况
  for (int i = 1; i <= n; ++i)
    for (int j = 0; j < m; ++j) {
      cin >> k;
      g[i] += !k << j;
    }
  // 枚举全部状态
  for (int st = 0; st < 1 << m; ++st) {
    if (check(st)) state.push_back(st);
  }
  // 枚举全部状态转移
  for (auto st : state) {
    for (auto ne_st : state) {
      if (!(st & ne_st)) {
        head[st].push_back(ne_st);
      }
    }
  }
  f[0][0] = 1;  // 什么也不种也是一种方案
  for (int i = 1; i <= n + 1; ++i) {
    for (auto st : state) {
      if (!(st & g[i])) {
        for (auto pre_st : head[st]) {
          f[i][st] = (f[i][st] + f[i - 1][pre_st]) % mod;
        }
      }
    }
  }
  cout << f[n + 1][0] << endl;
  return 0;
}
